<%@ page

import="web.Users"
import="java.util.*"
%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <meta charset="utf-8">
<%
String g_uid=request.getParameter("uid");
String pword=request.getParameter("pword");
String uname=new String();
String upw=new String();
HttpSession s=request.getSession();

if(g_uid!=null&&pword!=null&&!g_uid.equals("")){
	int uid=Integer.parseInt(g_uid);
	uname=Users.getUser(uid);
	upw=Users.checkUser(uid);
	if(upw!=null&&pword.equals(upw)==true){
		s.setAttribute("uname", uname);
		s.setAttribute("uid", uid);
		response.sendRedirect("index.jsp");
	}else{
		%><p>登录失败!</p><%
	}
}
%>

<form action="" method="get">
<p><input type="text" name="uid"></p>
<p><input type="password" name="pword"></p>
<p><input type="submit">&nbsp<a href="register.jsp">注册</a>&nbsp<a href="index.jsp">游客进入</a></p>

</form>